﻿<local:AnimatedRotatePhoneApplicationPage
    x:Class="Google_Plus.Pages.ProfilePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:Google_Plus.Types"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    Loaded="AnimatedRotatePhoneApplicationPage_Loaded">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="{Binding FullName}">
            <controls:PivotItem Header="Profile">
                <ScrollViewer>
                    <StackPanel Margin="10">
                        <TextBlock Text="Tagline" FontSize="26" />
                        <Border BorderThickness="1" BorderBrush="White" Margin="0,5" Padding="5,10">
                            <TextBlock Text="{Binding Tagline}" TextWrapping="Wrap"/>
                        </Border>
                        <TextBlock Text="Introduction" FontSize="26" Margin="0,20,0,0"/>
                        <Border BorderThickness="1" BorderBrush="White" Margin="0,5" Padding="5,10">
                            <TextBlock Text="{Binding Introduction}" TextWrapping="Wrap"/>
                        </Border>
                        <TextBlock Text="Occupation" FontSize="26" Margin="0,20,0,0"/>
                        <Border BorderThickness="1" BorderBrush="White" Margin="0,5" Padding="5,10">
                            <TextBlock Text="{Binding Occupation}" TextWrapping="Wrap"/>
                        </Border>
                        <TextBlock Text="Education" FontSize="26" Margin="0,20,0,0"/>
                        <Border BorderThickness="1" BorderBrush="White" Margin="0,5" Padding="5,10">
                            <ItemsControl ItemsSource="{Binding Education}" >
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Margin="0,0,0,10">
                                            <TextBlock Text="{Binding Name}" FontSize="24" TextWrapping="Wrap"/>
                                            <TextBlock Text="{Binding Description}" FontSize="20"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                        </Border>
                        <TextBlock Text="Places lived" FontSize="26" Margin="0,20,0,0"/>
                        <Image Height="200" Source="{Binding PlacesLivedMap}"/>

                        <TextBlock Text="Birthday" FontSize="26" Margin="0,20,0,0"/>
                        <Border BorderThickness="1" BorderBrush="White" Margin="0,5" Padding="5,10">
                            <TextBlock Text="{Binding Birthday}" TextWrapping="Wrap"/>
                        </Border>
                        <StackPanel Visibility="{Binding Converter={StaticResource BoolToVisibilityConverter}, Path=Gender}">
                            <TextBlock Text="Gender" FontSize="26" Margin="0,20,0,0"/>
                            <Border BorderThickness="1" BorderBrush="White" Margin="0,5" Padding="5,10">
                                <TextBlock Text="{Binding Gender}" TextWrapping="Wrap"/>
                            </Border>
                        </StackPanel>
                        <TextBlock Text="Other profiles" FontSize="26" Margin="0,20,0,0"/>
                        <Border BorderThickness="1" BorderBrush="White" Margin="0,5" Padding="5,10">
                            <ItemsControl ItemsSource="{Binding OtherProfiles}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Width="24" Height="24" Source="{Binding Icon}"/>
                                            <HyperlinkButton HorizontalContentAlignment="Left"
                                                             NavigateUri="{Binding Link}">
                                                <HyperlinkButton.Template>
                                                    <ControlTemplate>
                                                        <TextBlock Text="{Binding Name}"
                                                                   Foreground="#FFA2A2FF" />
                                                    </ControlTemplate>
                                                </HyperlinkButton.Template>
                                            </HyperlinkButton>
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                        </Border>
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>

            <controls:PivotItem Header="Posts">
                <ListBox ItemsSource="{Binding Posts}" 
                         Name="PostsList">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <local:PostView Tap="Button_Tap" 
                                                Tag="{Binding ID}">
                            </local:PostView>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                        </Style>
                    </ListBox.ItemContainerStyle>
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>
            </controls:PivotItem>

            <controls:PivotItem Header="Photos">
                <Grid/>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</local:AnimatedRotatePhoneApplicationPage>